#ifndef _FUNC_H_
#define _FUNC_H_
#include<stdio.h>
#include<string>
using namespace std;

typedef struct{
	const char* from_db_name;
	const char* uname;
	const char* passwd;
	const char* u_md5;
	const char* p_md5;
	const char* u_sha1;
	const char* p_sha1;
}Info_t;

class ParseDB
{
public:
	ParseDB(const char* from_db_name);
	virtual void start_parse();
protected:
	const char* m_from_dbname;
	FILE* pFromFile;
	FILE* pInfoFile;
	FILE* pErrorFile;
	virtual void info_output(Info_t info);
	void error_output(char* err_str);
	int cnt;
	string infoFile;
	string basestr;
};

class Parse12306DB : public ParseDB
{
public:
	Parse12306DB(const char* from_db_name):ParseDB(from_db_name){}
	virtual void start_parse();
};

class Parse7k7kDB : public ParseDB
{
public:
	Parse7k7kDB(const char* from_db_name):ParseDB(from_db_name){}
	virtual void start_parse();
};

class ParseDuduniuDB : public ParseDB
{
public:
	ParseDuduniuDB(const char* from_db_name):ParseDB(from_db_name){}
	virtual void start_parse();
};

class ParseShengdaDB : public ParseDB
{
public:
	ParseShengdaDB(const char* from_db_name):ParseDB(from_db_name){}
	virtual void start_parse();
};

class ParseWangyiDB : public ParseDB
{
public:
	ParseWangyiDB(const char* from_db_name):ParseDB(from_db_name){}
	virtual void start_parse();
};


class ParseCsdnDB : public ParseDB
{
public:
	ParseCsdnDB(const char* from_db_name):ParseDB(from_db_name){}
	virtual void start_parse();
};
#endif
